package com.qdu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qdu.entity.Users;
import com.qdu.mapper.UsersMapper;
import com.qdu.service.UsersService;

@Service
public class UsersServiceImpl implements UsersService {

	@Autowired
	UsersMapper usersMapper;

	@Override
	public boolean deleteUserById(String uid) {
		return usersMapper.deleteUserById(uid);
	}

	@Override
	public Users getOneUserById(String uid) {
		return usersMapper.getOneUserById(uid);
	}

	@Override
	public List<Users> getAllUsers() {
		return usersMapper.getAllUsers();
	}

	@Override
	public boolean addUser(Users user, int roleid) {
		return usersMapper.addUser(user, roleid);
	}

	@Override
	public boolean modifyUser(Users user, int roleid) {
		return usersMapper.modifyUser(user, roleid);
	}

	@Override
	public List<String> selectRoleNamesById(String uid) {
		return usersMapper.selectRoleNamesById(uid);
	}

	@Override
	public List<Users> getUsersByRoleId(int roleid) {
		return usersMapper.getUsersByRoleId(roleid);
	}

}
